﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using StreamWithProgress;
namespace ConsoleClient
{
    class Program
    {
        static void Main(string[] args)
        {
            try
            {
                String fileName = "E:\\Book.xls";
                System.IO.FileInfo fileInfo = new System.IO.FileInfo(fileName);
                using (System.IO.FileStream stream = new System.IO.FileStream(fileName, System.IO.FileMode.Open, System.IO.FileAccess.Read))
                {
                    using (StreamProgress upLoadStreamWithProcess = new StreamProgress(stream))
                    {
                        
                        // start service client
                        FileTranferClient.FileTransferServiceClient client = new FileTranferClient.FileTransferServiceClient();

                        // upload file
                        client.UploadFile(fileInfo.Name, fileInfo.Length, upLoadStreamWithProcess);

                        client.Close();
                    }
                }
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.ToString());
            }
            
        }
     
    }
}
